package com.PAT.practice02;
import java.util.*;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: zjz
 * @Date: 2021/12/16/17:48
 * @Description:
 * @Target:
 */
public class 字符统计 {
    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        String ss = in.nextLine();
        int[] sum = new int[26];  // 26个字母

        for (int i = 0; i < ss.length(); i++) {
            if (ss.charAt(i)>='A'&&ss.charAt(i)<='Z'){
                sum[(ss.charAt(i)-'A')]++;
            }else if (ss.charAt(i)>='a'&&ss.charAt(i)<='z'){
                sum[(ss.charAt(i)-'a')]++;
            }
        }

        int max = 0;
        int index = 0;
        for (int i = 0; i < sum.length; i++) {
            if (max<sum[i]){
                max = sum[i];
                index = i;
            }
        }

        System.out.println((char)(index+'a')+" "+max);

    }


}
